package com.aaa.java11.homework;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/14 16:03
 * @description：主任类
 * @modified By：
 * @version: 1.0
 */
public class Master   extends   AbstractDetail{
  private    Printer printer;

    public Printer getPrinter() {
        return printer;
    }

    public void setPrinter(Printer printer) {
        this.printer = printer;
    }

    @Override
    public String detail() {
        return "我是"+getName();
    }

    /**
     * 主人使用打印机打印master或者pet的详情
     * @param detail
     */
    public void makePrint(AbstractDetail detail){
        printer.print(detail.detail());
    }
}
